<style>
    .time {
        font-size: 14px;
        font-weight: bold;
    }

    .content {
        padding-left: 5px;
    }
</style>
<template>
    <span>
    <Button @click="showDrawer" type="success" size="small">发票信息</Button>
    <Drawer title="发票信息" :closable="false" placement="right" v-model="drawerVisible">
    <Timeline>
       <TimelineItem v-for="item in invoiceList">
            <p class="content">发票抬头：{{item.invoiceTitle}}</p>
            <p class="content" v-if="item.invoiceType==1" style="color: #52c41a">发票类型：个人发票</p>
            <p class="content" v-else style="color: #52c41a">发票类型：企业发票</p>
            <p class="content">发票内容：{{item.invoiceBody}}</p>
            <p class="content">开票金额：{{item.invoiceAmount}}</p>
            <p class="content" v-if="item.einvoice==1" style="color: #52c41a">开票方式：电子发票</p>
            <p class="content" v-else style="color: #52c41a">开票方式：纸质发票</p>
            <p class="content">联系电话：{{item.telephone}}</p>
            <p class="content">邮箱：{{item.email}}</p>
            <p class="content">企业税号：{{item.creditCode}}</p>
            <p class="content">邮寄地址：{{item.address}}</p>
            <p class="content">收件人：{{item.consignee}}</p>
            <p class="content">开户行：{{item.bankName}}</p>
            <p class="content">账户：{{item.bankNo}}</p>
            <p class="content">申请时间：{{item.createTime}}</p>
            <p class="content" v-if="item.invoiceKind==1" style="color: #52c41a">发票种类：普通发票</p>
            <p class="content" v-else style="color: #52c41a">发票种类：专用发票</p>
            <p class="content">快递公司：{{item.expressCompany}}</p>
            <p class="content">快递单号：{{item.expressNo}}</p>
        </TimelineItem>
    </Timeline>
    </Drawer>
    </span>
</template>
<script>
    import {invoiceList} from "@/api/bus";

    export default {
        name: "invoiceDrawer",
        props: {
            id: ""
        },
        data() {
            return {
                drawerVisible:false,
                invoiceList: []
            }
        },
        methods: {

            //加载数据
            showDrawer() {
                this.type = 1;
                this.drawerTitle = "发票信息";
                this.drawerVisible = true;
                this.getData();

            },
            getaaa(a){
                alert(a.code);
            },
            getData() {
                this.loading = true;
                invoiceList(this.id).then(res => {
                    this.loading = false;
                    if (res.status === true) {
                        console.info(JSON.stringify(res.data));
                        console.info(this.invoiceList);
                        this.invoiceList = res.data;
                    }
                });
            }

        }
    }
</script>